home *** CD-ROM | disk | FTP | other *** search
- global gWinVoiceXobj, gVoiceCmd, gVoiceConfidence, gVoiceHandler, gVoiceDisabled, gWinVoiceLastCmd, gWINListenStatus, gWinVoiceEnabled, gTrekCursor, gSpeechCapable, gWINvoiUserPermit, gVoicemode, gMaxLinks, gWinVoiceStartedWaiting, gSpeechWasChosenF, gModeState
-
- on hComputerMode
- hWinVoiceMicOff(-1)
- hearit(the number of cast "HoloBeep.se")
- hWinVoiceMicOn()
- end
-
- on hHyperlinkMousedown
- if rollOver(2) or rollOver(3) or rollOver(4) or rollOver(5) then
- hVoiceEntryClick()
- else
- if rollOver(24) then
- hVoiceIndexClick(the mouseLine)
- else
- put "PASSING!!!!!!!"
- hCancel()
- dontPassEvent()
- end if
- end if
- end
-
- on hHyperlinkMouseUp
- end
-
- on hHyperlinkKeyDown
- end
-
- on hLinkSeeListItem num
- global gVoiceStyleList, gdescfield, gVoiceHotItemList, gVoiceHotWordnumList, gFirstHotWord
- put "IN HLINKSEELISTITEM: " & num
- set gFirstHotWord to 0
- set itemNum to getAt(gVoiceHotItemList, num)
- set wordnum to getAt(gVoiceHotWordnumList, num)
- put "word,item = " && wordnum && itemNum
- hCancel()
- set wordChunk to getAt(getaProp(gVoiceStyleList, wordnum), 1)
- if wordChunk = EMPTY then
- put "wordChunk is empty"
- return
- end if
- set tmpChunk to word wordnum to wordnum + wordChunk of field gdescfield
- set oldDelim to the itemDelimiter
- set the itemDelimiter to ";"
- set tmpChunk to item 1 to itemNum of tmpChunk
- set dstWord to the number of words in tmpChunk
- set dstWord to dstWord + wordnum - 1
- put "DestWord = " & dstWord & " is " & word dstWord of field gdescfield
- set the itemDelimiter to oldDelim
- test(dstWord)
- end
-
- on hLink num
- global gVoiceStyleList, gdescfield, gVoiceHotItemList, gVoiceHotWordnumList
- set num to integer(num)
- put "TRYING TO HLINK " & num
- if gVoicemode = "LINK" then
- if num < 8 then
- put "About to hVoiceIndexClick"
- hVoiceIndexClick(num)
- else
- set num to num - 7
- if num > count(gVoiceHotItemList) then
- put "num is TOO HIGH! Exiting hLink"
- return
- end if
- if getAt(gVoiceHotItemList, num) > 0 then
- hLinkSeeListItem(num)
- else
- set n to count(gVoiceStyleList)
- put gVoiceStyleList
- set linkCount to 0
- set clickword to 0
- repeat with i = 2 to n
- put "in repeat loop"
- set W1 to getPropAt(gVoiceStyleList, i)
- set runStyle to getAt(getAt(gVoiceStyleList, i), 2)
- if runStyle = #b then
- set linkCount to linkCount + 1
- if linkCount = num then
- set clickword to W1
- exit repeat
- end if
- end if
- end repeat
- put gVoiceStyleList
- put "HYPERLINK TO WORD: " & clickword
- hCancel()
- test(clickword)
- end if
- end if
- end if
- end
-
- on hWinVoiceQuitting_MicOn
- if objectp(gWinVoiceXobj) then
- if gWinVoiceEnabled = 1 then
- repeat while soundBusy(1)
- nothing()
- end repeat
- repeat while soundBusy(2)
- nothing()
- end repeat
- puppetSound(0)
- gWinVoiceXobj(mSetMicState, 1)
- set gWINListenStatus to 1
- end if
- end if
- end
-
- on hWinVoiceStartQuit
- global gMicWasOnBeforeQuit
- put "quit" into line 2 of gVoicemode
- if objectp(gWinVoiceXobj) then
- gWinVoiceXobj(mSetState, "quitting")
- set gMicWasOnBeforeQuit to hWinVoiceMicState()
- put "gMicWasOnBeforeQuit=" & gMicWasOnBeforeQuit
- if gMicWasOnBeforeQuit = 0 then
- put "inside if"
- set gWINListenStatus to 0
- hWinVoiceQuitting_MicOn()
- end if
- end if
- end
-
- on hWinVoiceEndQuit
- global gMicWasOnBeforeQuit
- if (gVoicemode <> 0) and (gVoicemode <> EMPTY) then
- put "gVoiceMode = " & gVoicemode
- set gVoicemode to line 1 of gVoicemode
- end if
- if objectp(gWinVoiceXobj) then
- gWinVoiceXobj(mSetState, "omni")
- if gMicWasOnBeforeQuit = 0 then
- hWinVoiceMicOff()
- end if
- end if
- end
-
- on hStartLink
- global gIndxScrollFldK, gSavedMouseDownScript, gSavedMouseUpScript, gSavedKeyDownScript
- if gVoicemode <> "LINK" then
- set gVoicemode to "LINK"
- hVoiceShowLinks()
- hVoiceShowIndexLinks()
- set the textStyle of cast gIndxScrollFldK to "plain"
- set gSavedMouseDownScript to the mouseDownScript
- set gSavedMouseUpScript to the mouseUpScript
- set gSavedKeyDownScript to the keyDownScript
- set the mouseDownScript to "hHyperlinkMouseDown"
- set the mouseUpScript to "hHyperlinkMouseUp"
- set the keyDownScript to "hHyperlinkKeyDown"
- if objectp(gWinVoiceXobj) then
- gWinVoiceXobj(mSetState, "link")
- end if
- hReportStatus("Speak the number of an entry to retrieve it, or 'Cancel' to return.")
- end if
- end
-
- on hCleanUpLinkMode
- global gIndxScrollFldK, oIndexSlider, oIndexScroller, gVoiceSavedIndex
- if gVoicemode = "LINK" then
- set the textStyle of field gIndxScrollFldK to "plain"
- put gVoiceSavedIndex into field gIndxScrollFldK
- end if
- end
-
- on hEndLinkMode
- global gSavedMouseDownScript, gSavedMouseUpScript, gSavedKeyDownScript
- set gVoicemode to EMPTY
- if objectp(gWinVoiceXobj) then
- gWinVoiceXobj(mSetState, "omni")
- end if
- set the mouseDownScript to gSavedMouseDownScript
- set the mouseUpScript to gSavedMouseUpScript
- set the keyDownScript to gSavedKeyDownScript
- end
-
- on hCancel
- global gVoiceSearchText
- put "CANCEL"
- if gVoicemode = "LINK" then
- hCleanUpLinkMode()
- hEndLinkMode()
- hProcess(gVoiceSearchText)
- end if
- end
-
- on hVoiceIndexClick pLine
- global gIndxScrollFldK, oIndexScroller
- if pLine = -1 then
- set pLine to the mouseLine
- end if
- put "VOICEINDEXCLICK" && pLine && line pLine of field gIndxScrollFldK
- set vLinkto to line pLine of field gIndxScrollFldK
- hCleanUpLinkMode()
- hEndLinkMode()
- if vLinkto <> EMPTY then
- put "VOICEINDEXCLICK inside if with " & pLine
- mJumpIndex(oIndexScroller, pLine)
- hMiniFind()
- end if
- end
-
- on hVoiceEntryClick pLine
- global gdescfield
- set pLine to the mouseLine
- set vLinkto to line pLine of field gdescfield
- if vLinkto = EMPTY then
- hCleanUpLinkMode()
- hEndLinkMode()
- else
- hLink(pLine + 7)
- end if
- dontPassEvent()
- end
-
- on hVoiceShowIndexLinks
- global gdescfield, gIndxScrollFldK, gVoiceSavedIndex
- set gVoiceSavedIndex to field gIndxScrollFldK
- set n to 1
- repeat while 1
- set Lw to line n of field gIndxScrollFldK
- if Lw = EMPTY then
- exit repeat
- end if
- put n & ". " & Lw into line n of tmpFld
- set n to n + 1
- if n = 8 then
- exit repeat
- end if
- end repeat
- put tmpFld into field gIndxScrollFldK
- set gTempLexicon to [:]
- end
-
- on filter pWord
- set nChars to the number of chars in pWord
- set n to 1
- set buildStr to EMPTY
- repeat with i = 1 to nChars
- set c to char i of pWord
- if (c <> ".") and (c <> ",") and (c <> ")") and (c <> "(") then
- put c into char n of buildStr
- set n to n + 1
- end if
- end repeat
- return buildStr
- end
-
- on hVoiceShowLinks
- global gdescfield, gVoiceStyleList, gVoiceEntry, gVoiceHotItemList, gVoiceHotWordnumList, gModeState, oTextScroller, gVoiceSearchText
- set gVoiceHotItemList to []
- set gVoiceHotWordnumList to []
- if (gModeState = #CHRO) or (gModeState = #TOPICS) or (gModeState = #Resources) then
- return
- end if
- mHomeScrollFields(oTextScroller)
- set vEntry to hParseAttrib(gVoiceSearchText)
- set oldDelim to the itemDelimiter
- set the itemDelimiter to "@"
- set vStyles to item 1 of vEntry
- set vHeading to item 2 of vEntry
- delete char 1 of vHeading
- delete item 1 of vEntry
- delete item 1 of vEntry
- delete char 1 of vEntry
- set the itemDelimiter to oldDelim
- set gVoiceEntry to vEntry
- do("set gVoiceStyleList=[" & vStyles & "]")
- sort(gVoiceStyleList)
- set numStyles to count(gVoiceStyleList)
- put gVoiceStyleList
- set wordOff to the number of words in vHeading
- set n to 1
- repeat with i = 2 to numStyles
- set W1 to getPropAt(gVoiceStyleList, i)
- set origW1 to W1
- set wLast to getAt(getAt(gVoiceStyleList, i), 1) + W1 - 1
- set W1 to W1 - wordOff
- set wLast to wLast - wordOff
- set runStyle to getAt(getAt(gVoiceStyleList, i), 2)
- if (runStyle = #b) or (runStyle = #bi) or (runStyle = #bu) then
- put "HYPERLINK: " & word W1 to wLast of vEntry
- set Lchunk to word W1 to wLast of vEntry
- put "LChunk=" & Lchunk
- if Lchunk contains ";" then
- set Ltidl to the itemDelimiter
- set the itemDelimiter to ";"
- set Lsz to the number of items in Lchunk
- repeat with j = 1 to Lsz
- if (n + 7) > 21 then
- exit repeat
- end if
- put "adding item " & n + 7 & " = " & item j of Lchunk
- if item j of Lchunk <> EMPTY then
- put n + 7 & ". " & filter(item j of Lchunk) into line n of hotList
- setAt(gVoiceHotItemList, n, j)
- setAt(gVoiceHotWordnumList, n, origW1)
- set n to n + 1
- end if
- end repeat
- set the itemDelimiter to Ltidl
- next repeat
- end if
- if (n + 7) > 21 then
- exit repeat
- end if
- put n + 7 & ". " & filter(Lchunk) into line n of hotList
- setAt(gVoiceHotItemList, n, -1)
- setAt(gVoiceHotWordnumList, n, origW1)
- set n to n + 1
- end if
- end repeat
- put "After showing links, indexlist=" && gVoiceHotItemList
- put gVoiceHotWordnumList
- put hotList into field gdescfield
- put hotList
- end
-
- on test wordnum
- global gTheMseWord, gHotLinkList, gchunksize, gFirstHotWord
- put "wordnum=" & wordnum
- if wordnum > 0 then
- set Lkeylistitem to getaProp(gHotLinkList, wordnum)
- put "wordnum=" & wordnum && " Lkeylistitem=" & Lkeylistitem
- if not voidp(Lkeylistitem) then
- set gchunksize to getAt(getAt(gkeylist, Lkeylistitem), 1)
- set gFirstHotWord to getPropAt(gkeylist, Lkeylistitem)
- set gTheMseWord to wordnum
- put "gchunksize=" & gchunksize && " gFirstHotWord=" & gFirstHotWord
- hGrabStringNsearch(gdescfield, "dumbFlag")
- else
- put "NOT A HOTWORD"
- set gFirstHotWord to 0
- end if
- end if
- set gFirstHotWord to 0
- set gchunksize to 0
- end
-